#include "ftpstoragewidget.h"

FTPStorageWidget::FTPStorageWidget(QWidget *parent) :
    QWidget(parent)
{
    QGridLayout *centralLayout = new QGridLayout();
    this->setLayout(centralLayout);

    QLabel *hostLabel = new QLabel(tr("Host: "));
    centralLayout->addWidget(hostLabel, 1, 1);

    hostValue = new QLineEdit();
    centralLayout->addWidget(hostValue, 1, 2);

    QLabel *usernameLabel = new QLabel(tr("Login: "));
    centralLayout->addWidget(usernameLabel, 2, 1);

    usernameValue = new QLineEdit();
    centralLayout->addWidget(usernameValue, 2, 2);

    QLabel *passwordLabel = new QLabel(tr("Password: "));
    centralLayout->addWidget(passwordLabel, 3, 1);

    passwordValue = new QLineEdit();
    passwordValue->setEchoMode(QLineEdit::Password);
    centralLayout->addWidget(passwordValue, 3, 2);

    QLabel *directoryLabel = new QLabel(tr("Directory: "));
    centralLayout->addWidget(directoryLabel, 4, 1);

    directoryValue = new QLineEdit();
    centralLayout->addWidget(directoryValue, 4, 2);
}

QString FTPStorageWidget::getHost()
{
    return this->hostValue->text();
}

QString FTPStorageWidget::getLogin()
{
    return this->usernameValue->text();
}

QString FTPStorageWidget::getPass()
{
    return this->passwordValue->text();
}

QString FTPStorageWidget::getDir()
{
    return this->directoryValue->text();
}
